<template>
  <!-- 意见反馈 -->
  <view class="container">
    <view class="contain">
      <textarea
	  style="width: calc(100% - 48rpx);
	  height: 400rpx;background:#fff;padding: 24rpx"
        v-model="optionValue"
        maxlength="-1"
        placeholder="我们想听听你的心声，如果愿意，你也可以留下联系方式，我们期待与你的真诚沟通。"
        border="none"
        placeholder-class="placeholder_style"
      ></textarea>
    </view>
    <view class="submit">
      <view class="submit-btn"  @tap="addOpinion">提交</view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      optionValue: "",
    };
  },

  methods: {
    addOpinion() {
      if (!this.optionValue) {
        return vk.toast("请输入内容", "none");
      }
      vk.callFunction({
        url: "user/kh/feedbackPost",
        data: {
          content: this.optionValue,
        },
        success: (res) => {
          uni.hideLoading();
          vk.toast("提交成功", "none");
          setTimeout(() => {
            uni.navigateBack({
              delta: 1,
            });
          }, 1000);
        },
      });
    },
  },
};
</script>

<style scoped lang="scss">

.submit {
    position: fixed;
    left: 0;
    bottom: calc(var(--safe-area-inset-bottom) + 40rpx);
    width: 100%;
    height: 90rpx;
    display: flex;
    align-items: center;
    justify-content: center;

    &-btn {
      width: 730rpx;
      height: 74rpx;
      line-height: 74rpx;
      background-color: #005ECD;
      border-radius: 100rpx;
      text-align: center;
      color: #fff;
      font-family: PingFang SC;
      font-size: 26rpx;
      font-style: normal;
      font-weight: 500;
    }
  }
.container {
  padding: 24rpx 30rpx;

  .contain {
    border-radius: 18rpx;
    overflow: hidden;

    /deep/.placeholder_style {
      line-height: 36rpx !important;
    }

    /deep/.u-textarea__field.data-v-81cd9d32 {
      line-height: 36rpx !important;
      font-size: 26rpx !important;
    }
  }

  .contain_bottom_fixed2 {
    margin: 18rpx 30rpx;

    /deep/.u-button.data-v-3bf2dba7 {
      height: 74rpx;
    }
  }
}
</style>
